from Yk_liushuai.Base.Base import Base
from selenium.webdriver.common.by import By
import time
class Page(Base):
    weixinch_loc=(By.ID,'weixinch')
    # 断言页面标题微信
    def weixin(self):
        self.text(self.weixinch_loc)
    # 搜索框输入软件测试自动化
    sousuok_loc=(By.CSS_SELECTOR,'.sec-input')
    def sousuok(self):
        self.send_keys(self.sousuok_loc,'软件测试自动化')
    # 点击搜索按钮
    stb_loc=(By.ID,'stb')
    def stb(self):
        self.click(self.stb_loc)
    # bioati_loc=(By.XPATH,'//*[@id="ad_result_leftup_0"]/div/h4/a/span')
    # def biaoti(self):
    #     self.click(self.bioati_loc)
    # dy2=(By.XPATH,'//*[@id="ad_result_leftup_0"]/div/h4/a/span')
    # # 断言软件测试
    # def dy21(self):
    #     self.text(self.dy2)

    # 点击第二页
    sogou_page_2=(By.ID,'sogou_page_2')
    def sogou_page(self):
        self.click(self.sogou_page_2)






    def test_login(self):
        # print(self.weixin())
        self.sousuok()
        self.stb()
        # 隐式等待
        self.driver.implicitly_wait(10)
        # self.biaoti()
        # self.dy21()
        # print(self.dy21())
        # assert '软件测试' in self.dy21()
        time.sleep(3)
        self.sogou_page()
        time.sleep(3)




